#include "settingscontroller.h"

SettingsController::SettingsController(QWidget *parent)
{
    settingsView = new SettingsView(parent);
    mainWidget = parent;
    closeView();
    connect(settingsView->closebtn,SIGNAL(clicked()),this,SLOT(closeView()));
    connect(settingsView->pushButton[0],SIGNAL(clicked()),this,SLOT(luminancePageShow()));
    connect(settingsView->pushButton[1],SIGNAL(clicked()),this,SLOT(systemVersionPageShow()));


    luminanceController = new LuminanceController(settingsView);
    systemVersionController = new SystemVersionController(settingsView);

}

SettingsController::~SettingsController()
{

}

void SettingsController::show()
{
    settingsView-> setGeometry(mainWidget->width()-384,21,settingsView->width() == 0 ?384:0,settingsView->height() == 0?558:0);
}

void SettingsController::closeView()
{
    settingsView-> setGeometry(0,0,0,0);
}

void SettingsController::luminancePageShow()
{
    qDebug() <<"点击亮度";
    luminanceController->show();
}

void SettingsController::systemVersionPageShow()
{
    systemVersionController->show();
    qDebug() <<"点击系统版本";
}
